<template>
	<view v-if="themeInfo != '005' && themeInfo != '006'">
		<!-- 权益会员vip -->
		<view @tap="$u.throttle(vipClick, 500)" style="position: fixed;bottom:120rpx; left: 0;height: 88rpx;width: calc(100vw - 48rpx);padding:0 24rpx;background: linear-gradient(to right, #FFE6B2, #FFF9D9);" class="chxy-row-c-c">
			<image src="https://jtmc.oss-cn-hangzhou.aliyuncs.com/h5-uniapp/h5-order/qyhy.png" style="width: 120rpx;height: 40rpx;"></image>
			<view style="width: 370rpx;margin: 0 14rpx;">
				<text style="font-size: 32rpx;">本单优惠{{saleFiffVip || 0}}元</text>
				<view style="color: #9B3F00;font-size: 20rpx;">开通后立即获得，再享更多酒水权益价</view>
			</view>
			<text style="width: 150rpx;font-size: 24rpx;color: #212121;">
				￥{{cardInfo.payCardAmt}}/{{cardInfo.payCardDays}}天
			</text>
			<image v-show="!vipClickFlag" src="https://oss.jtmckj.com/wmp/images/common/i_radio_check.png" style="height: 32rpx;width: 32rpx;"></image>
			<image v-show="vipClickFlag" src="https://jtmc.oss-cn-hangzhou.aliyuncs.com/h5-uniapp/h5-order/check-red.png" style="width: 32rpx;height: 32rpx;"></image>
		</view>
	</view>
</template>

<script setup>  
	import { HFiveMemberAppObjProcess } from '@/api/public.js'
	import { onLoad, onShow, onHide, onPageScroll, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app';
	import { ref, reactive, onMounted, nextTick, defineEmits, defineExpose, defineProps } from 'vue';
	import { initCardInfo, getCardInfoMore,numMultiFun,numAddFun } from "@/until/tools.js"
	import { useCartStore } from '@/store/cart.js';
	import { useCardStore } from '@/store/card.js';
	import { useTableStore } from '@/store/table.js';
	
	const props = defineProps({
		saleFiffVip: {
			type: [String,Number], 
			default: '0'
		}, 
		
	}); 
	const themeInfo = ref(uni.getStorageSync('themeInfo')?.type)
	const storeTable = useTableStore();
	const storeCart = useCartStore();
	const storeCard = useCardStore(); 
	const vipClickFlag = ref(false) 
	const cardInfo = ref({}) 
	const vipClick = () => { 
		vipClickFlag.value = !vipClickFlag.value
		// 通知价格变化
		emit('updateVipFlag',vipClickFlag.value);
	}
	
	onShow(()=>{
		cardInfo.value = uni.getStorageSync('cardInfo') 
	})
	const initStatus = (initStatus) => {
		console.log('initStatus：',initStatus)
		vipClickFlag.value = initStatus
		console.log('benefit-vipbenefit-vipbenefit-vip show');
		cardInfo.value = uni.getStorageSync('cardInfo') 
	}
	 

	// 定义触发事件
	const emit = defineEmits(['updateVipFlag']);
	
	defineExpose({
		initStatus
	});
</script>

<style>
</style>